package com.fy.dao;

import com.alibaba.druid.pool.ha.selector.StickyDataSourceHolder;
import com.fy.entity.User_info;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface User_infoMapper {
    @Select("select * from user_info")
    List<User_info> findAll();
    @Select("select * from user_info where info_id=#{info_id}")
    List<User_info> getInfo(@Param("info_id")String info_id);

    //新增用户信息表，默认在用户注册时调用
    @Insert("INSERT into user_info(info_id,user_id, nick_name, gender, sign, address,user_avatar) values(#{info_id},#{user_id}, #{nick_name}, #{gender}, #{sign}, #{address},#{user_avatar})")
    int insert_info(@Param("info_id") String info_id, @Param("user_id") String user_id, @Param("nick_name") String name,
                    @Param("gender") String gender, @Param("sign") String sign,
                    @Param("address") String address,@Param("user_avatar")String user_avatar);

    @Update("update user_info set nick_name=#{nick_name},gender=#{gender},sign=#{sign},address=#{address},jf=#{jf} where info_id=#{info_id}")
    int update_info(@Param("nick_name")String nick_name, @Param("gender")String gender,
                    @Param("sign")String sign, @Param("address")String address,
                    @Param("jf")int jf,
                    @Param("info_id")String info_id);
}
